home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / Rice_CMS / gopher24 / expand.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1992-12-07  |  739 b   |  33 lines

  1. /*
  2.  *        Name: EXPAND REXX
  3.  *              Expand Tab Characters function as a pipeline filter
  4.  *              This gem can be replaced with  UNTAB 8,  if available.
  5.  *      Author: Rick Troth, Rice University, Information Systems
  6.  *        Date: 1992-Apr-17, Dec-06
  7.  */
  8.  
  9. /*  'CALLPIPE *: | UNTAB 8 | *:'  */
  10.  
  11. Do Forever
  12.  
  13.     'PEEKTO LINE'
  14.     If rc ^= 0 Then Leave
  15.  
  16.     tabpos = Pos('05'x,line)
  17.     Do While tabpos > 0
  18.         line = Substr(line,1,tabpos-1) || ,
  19.                Copies('40'x,((tabpos+7)%8)*8-tabpos+1) || ,
  20.                Substr(line,tabpos+1)
  21.         tabpos = Pos('05'x,line)
  22.         End  /*  Do  While  */
  23.  
  24.     'OUTPUT' line
  25.     If rc ^= 0 Then Leave
  26.  
  27.     'READTO'
  28.  
  29.     End  /*  Do  While  */
  30.  
  31. Exit rc * (rc ^= 12)
  32.  
  33.